var testbutton = document.getElementById('test');
function jqueryPost(servlet,data)
{
   $.post(servlet,data,
       function(response)
       {
           search_event_response_ready(response);
       }
    ,"json");
}
function httpPost(URL,param,func)
{
    var xmlHttp = null;

    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "POST", URL, true );
    xmlHttp.setRequestHeader('Content-Type', 'application/json', 'charset=UTF-8');
    
    var string = JSON.stringify(param);
    xmlHttp.send(string);

    
    //xmlHttp.setRequestHeader('Access-Control-Allow-Origin', 'http://localhost:8888');
    
    xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
        if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            func(xmlHttp.responseText);
        }
    }
    return xmlHttp.responseText;
}


var _events;
var eventContent = document.getElementById("EventContent");
var loadMainPage = function()
{
    eventContent.innerHTML = "Nothing Found...";
    var backbutton = document.getElementById('back');
    backbutton.onclick = loadEvents;
}



/*testbutton.onclick = function()
{
    replaceContent(testbutton,'ha');
    //httpPost(encodeURI('http://netdb-ask125.appspot.com/comment/haha/yea'));
    search_event('','time');
    
}*/

function replaceContent(element,content)
{
    element.innerHTML = content;
}
